<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>定时器</title>
</head>
<script>
i = 0;
function fn1(){
	i++;
	document.title = i;
	if (i === 10){
		clearInterval(timer);
	}
}
var timer = setInterval(fn1,500);
</script>
<body>
</body>
</html>
